package com.xiangyang.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@TableName(value = "scheduling")
public class Sceduling extends BaseEntity {
    @TableId(value = "scheduling_id",type = IdType.AUTO)
    private Long schedulingId;       //部门id
    private Long doctorId;           //医生id
    private Long departmentId;     //医生部门id
    private Long duty;               //值班
    private Date time;               //时间

    public String getDutyString() { return duty==0 ? "夜班" : duty==1 ? "白班" : "没有这个选项";}
     @Override
    public Long getId() {
        return getSchedulingId();
    }
    @Override
    public void setId(Long id) {
        setSchedulingId(id);
    }

    public void setSchedulingId(Long schedulingId) {
        this.schedulingId = schedulingId;
        // 同步设置 BaseEntity 的 id
        super.setId(schedulingId);
    }
}
